import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import Header from "@/components/Header";
import ReactQueryProvider from "@/lib/react-query-provider";
import GlobalLoading from "@/components/GlobalLoading";
import ErrorToast from "@/components/ErrorToast";

const geistSans = Geist({
  variable: "--font-geist-sans",
  subsets: ["latin"],
});

const geistMono = Geist_Mono({
  variable: "--font-geist-mono",
  subsets: ["latin"],
});

export const metadata: Metadata = {
  title: "我的博客 - 分享技术、记录生活",
  description: "一个简单、高效、专业的博客平台",
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="zh-CN">
      <body
        className={`${geistSans.variable} ${geistMono.variable} antialiased`}
      >
        <ReactQueryProvider>
          <GlobalLoading />
          <ErrorToast />
          <Header />
          {children}
        </ReactQueryProvider>
      </body>
    </html>
  );
}
